package cemp.controller;

import cemp.common.dto.Response;
import cemp.dto.DailySubjectDto;
import cemp.dto.DailyTaskDto;
import cemp.service.DailySubjectService;
import cemp.service.DailyTaskService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@AllArgsConstructor
@RequestMapping("/daily/subject")
public class AppDailySubjectController {

    @Autowired
    DailySubjectService dailySubjectService;

    @GetMapping("/getall")
    public List<DailySubjectDto> getall() {
        return dailySubjectService.getAll();
    }

    @PostMapping("/add")
    public Response<Void> doAdd(@RequestBody DailySubjectDto subjet) {
        dailySubjectService.doadd(subjet);
        return Response.success();
    }

    @PostMapping("/delete")
    public Response<Void> doDelete(@RequestBody DailySubjectDto subjet) {
        dailySubjectService.doDelete(subjet);
        return Response.success();
    }



}
